<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建 JavaScript 对象</title>
</head>

<body>
    <h1>JavaScript 对象</h1>
    <p id="demo"></p>
    <script>
        //创建对象：
        var car = { type: "porsche", model: "919", color: "black" };
        // 显示对象中的数据：
        document.getElementById("demo").innerHTML = car.type;
    </script>
</body>

</html>